﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using PloobsEngine.Components;
using PloobsEngine.Publishers;


namespace PloobsEngine.Tasks
{   
    public class TaskProcessor :   BasicComponent
    {
        public TaskProcessor(EngineStuff es)            
        {
            
        }
        
        private delegate void Task();
        public static readonly String MyName = "TaskProcessor";
        private ISubject _sub = new ConcreteSubject();
        
                
        public void StartTask(ITask task)
        {
            Task t = new Task(task.Process);
             t.BeginInvoke(new AsyncCallback(task.Result), null);                
        }


        public override ComponentType ComponentType
        {
            get { return ComponentType.NONE; }
        }

        #region IReciever Members

        public override  string getMyName()
        {
            return MyName;
        }

        #endregion


     
    }


}
